// import { BroswerRouter as Router, Route, Redirect } from 'react-router-dom'
import { BrowserRouter as Router, Route, Redirect } from 'react-router-dom'

import Login from './pages/Login'
import Layout from './pages/Layout'

const App = () => {
  return (
    <Router>
      <div className="app">
        {/* 通过配置默认路由重定向到home页面，一进入页面，就显示home页面 */}
        <Route exact path="/" render={() => <Redirect to="/home" />}></Route>
        {/* <Route path="/login" component={Login}></Route>
        <Route path="/layout" component={Layout}></Route> */}
        <Route path="/login">
          <Login />
        </Route>
        <Route path="/home">
          <Layout />
        </Route>
      </div>
    </Router>
  )
}

export default App
